home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
cmn_err.h.z
/
cmn_err.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
3KB
|
106 lines
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/*#ident "@(#)kern-port:sys/cmn_err.h 10.5"*/
#ident "$Revision: 3.18 $"
#include "sys/syslog.h"
/*
** Common error handling severity levels. Converted to be
** represented by the associated 4.3BSD syslog priorities.
*/
#define CE_DEBUG LOG_DEBUG /* debug */
#define CE_CONT LOG_INFO /* continuation */
#define CE_NOTE LOG_NOTICE /* notice */
#define CE_WARN LOG_WARNING /* warning */
#define CE_PANIC LOG_EMERG /* panic */
#define CE_LEVELMASK LOG_PRIMASK /* mask for severity level */
#define CE_CPUID 0x8 /* prepend CPU id to output */
/* Codes for where output should go. */
#define PRW_BUF 0x01 /* Output to putbuf. */
#define PRW_CONS 0x02 /* Output to console via sprom. */
#define PRW_ABUF 0x04 /* Output to arbitrary buffer. */
#ifdef _KERNEL
/* Console output flushing flag and routine */
extern int constrlen; /* Length of current console string, if zero,
there are no characters to flush */
extern void cmn_err(int, char *, ...);
#define CONBUF_LOCKED 0 /* conbuf is already locked */
#define CONBUF_UNLOCKED 1 /* need to reacquire lock */
/*
* bit field descriptions for printf %r and %R formats
*
* printf("%r %R", val, reg_descp);
* struct reg_desc *reg_descp;
*
* the %r and %R formats allow formatted print of bit fields. individual
* bit fields are described by a struct reg_desc, multiple bit fields within
* a single word can be described by multiple reg_desc structures.
* %r outputs a string of the format "<bit field descriptions>"
* %R outputs a string of the format "0x%x<bit field descriptions>"
*
* The fields in a reg_desc are:
* unsigned rd_mask; An appropriate mask to isolate the bit field
* within a word, and'ed with val
*
* int rd_shift; A shift amount to be done to the isolated
* bit field. done before printing the isolate
* bit field with rd_format and before searching
* for symbolic value names in rd_values
*
* char *rd_name; If non-null, a bit field name to label any
* out from rd_format or searching rd_values.
* if neither rd_format or rd_values is non-null
* rd_name is printed only if the isolated
* bit field is non-null.
*
* char *rd_format; If non-null, the shifted bit field value
* is printed using this format.
*
* struct reg_values *rd_values; If non-null, a pointer to a table
* matching numeric values with symbolic names.
* rd_values are searched and the symbolic
* value is printed if a match is found, if no
* match is found "???" is printed.
*
*/
/*
* register values
* map between numeric values and symbolic values
*/
struct reg_values {
unsigned rv_value;
char *rv_name;
};
/*
* register descriptors are used for formatted prints of register values
* rd_mask and rd_shift must be defined, other entries may be null
*/
struct reg_desc {
unsigned rd_mask; /* mask to extract field */
int rd_shift; /* shift for extracted value, - >>, + << */
char *rd_name; /* field name */
char *rd_format; /* format to print field */
struct reg_values *rd_values; /* symbolic names of values */
};
#endif